
package com.bstek.urule.model.rete;

/**
 * @author Jacky.gao
 * @since 2015年3月6日
 */
public enum NodeType {
    and, or, criteria, namedCriteria, objectType, terminal;

    public static ReteNode newReteNodeInstance(NodeType type) {
        switch (type) {
            case and:
                return new AndNode();
            case or:
                return new OrNode();
            case criteria:
                return new CriteriaNode();
            case namedCriteria:
                return new NamedCriteriaNode();
            case objectType:
                return new ObjectTypeNode();
            case terminal:
                return new TerminalNode();
        }
        return null;
    }
}
